/*
 * Copyright (c) 2014. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.jspx.txweb.table;

import com.jspx.sober.annotation.Column;
import com.jspx.sober.annotation.IDType;
import com.jspx.sober.annotation.Id;
import com.jspx.sober.annotation.Table;
import com.jspx.sober.table.OperateTable;
import com.jspx.utils.StringUtil;

/**
 * Created by yuan on 14-3-1.
 * 用户所属关系表，是一个总表，各个软件里边的用户域
 * 第一个子用户就是自己的创建者，查询子用户的时候不用 memberId
 */
@Table(name = "jspx_member_space", caption = "用户域")
public class MemberSpace extends OperateTable {
    @Id(auto = true, type = IDType.serial)
    @Column(caption = "ID", notNull = true)
    private long id;

    @Column(caption = "主用户ID", notNull = true)
    private long  memberId = 0;

    @Column(caption = "主用户名", length = 50, dataType="isLengthBetween(0,50)",notNull = true)
    private String  memberName = StringUtil.empty;

    @Column(caption = "子用户ID", notNull = true)
    private long  childId = 0;

    @Column(caption = "子用户名", length = 50, dataType="isLengthBetween(0,50)",notNull = true)
    private String  childName = StringUtil.empty;

    //公司ID，对应 businessCard
    @Column(caption = "域", notNull = true)
    private long organizeId  = 0;

    @Column(caption = "组织名称", length = 200, dataType="isLengthBetween(0,200)",notNull = true)
    private String  organize  = StringUtil.empty;

    @Column(caption = "命名空间", length = 50, notNull = true)
    private String namespace = StringUtil.empty;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getMemberId() {
        return memberId;
    }

    public void setMemberId(long memberId) {
        this.memberId = memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public long getChildId() {
        return childId;
    }

    public void setChildId(long childId) {
        this.childId = childId;
    }

    public String getChildName() {
        return childName;
    }

    public void setChildName(String childName) {
        this.childName = childName;
    }

    public long getOrganizeId() {
        return organizeId;
    }

    public void setOrganizeId(long organizeId) {
        this.organizeId = organizeId;
    }

    public String getOrganize() {
        return organize;
    }

    public void setOrganize(String organize) {
        this.organize = organize;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }
}